package xhwl.insurance.http.bean.resp;

import android.support.annotation.NonNull;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import xhwl.insurance.db.bean.SaleInfo;

/**
 * Created by admin on 2017/7/31.
 */

public class ProcessListResp implements Serializable, Comparable<ProcessListResp> {

    public String SALE_TYPE;
    public String PERSON_NAME;
    public String PERSON_MOBILE;
    public String PERSON_IDCARD;
    public String CREATE_DATE;
    public String SALE_NAME;
    public String ORDER_STATUS;
    public String BUY_ID;

    public String CARD_NUMBER;
    public String CARD_PIC_FORNT;
    public String CARD_PIC_BACK;
    public String CARD_NUMBER_PIC;
    public String CARD_PIC;

    public String getCARD_PIC() {
        return CARD_PIC;
    }

    public void setCARD_PIC(String CARD_PIC) {
        this.CARD_PIC = CARD_PIC;
    }

    public SaleInfo savedSaleInfo;

    public String getCARD_PIC_FORNT() {
        return CARD_PIC_FORNT;
    }

    public void setCARD_PIC_FORNT(String CARD_PIC_FORNT) {
        this.CARD_PIC_FORNT = CARD_PIC_FORNT;
    }

    public String getCARD_PIC_BACK() {
        return CARD_PIC_BACK;
    }

    public void setCARD_PIC_BACK(String CARD_PIC_BACK) {
        this.CARD_PIC_BACK = CARD_PIC_BACK;
    }

    public String getCARD_NUMBER_PIC() {
        return CARD_NUMBER_PIC;
    }

    public void setCARD_NUMBER_PIC(String CARD_NUMBER_PIC) {
        this.CARD_NUMBER_PIC = CARD_NUMBER_PIC;
    }

    public String getCARD_NUMBER() {
        return CARD_NUMBER;
    }

    public void setCARD_NUMBER(String CARD_NUMBER) {
        this.CARD_NUMBER = CARD_NUMBER;
    }

    public String getBUY_ID() {
        return BUY_ID;
    }

    public void setBUY_ID(String BUY_ID) {
        this.BUY_ID = BUY_ID;
    }

    public String getSALE_TYPE() {
        return SALE_TYPE;
    }

    public void setSALE_TYPE(String SALE_TYPE) {
        this.SALE_TYPE = SALE_TYPE;
    }

    public String getPERSON_NAME() {
        return PERSON_NAME;
    }

    public void setPERSON_NAME(String PERSON_NAME) {
        this.PERSON_NAME = PERSON_NAME;
    }

    public String getPERSON_MOBILE() {
        return PERSON_MOBILE;
    }

    public void setPERSON_MOBILE(String PERSON_MOBILE) {
        this.PERSON_MOBILE = PERSON_MOBILE;
    }

    public String getPERSON_IDCARD() {
        return PERSON_IDCARD;
    }

    public void setPERSON_IDCARD(String PERSON_IDCARD) {
        this.PERSON_IDCARD = PERSON_IDCARD;
    }

    public String getCREATE_DATE() {
        return CREATE_DATE;
    }

    public void setCREATE_DATE(String CREATE_DATE) {
        this.CREATE_DATE = CREATE_DATE;
    }

    public String getSALE_NAME() {
        return SALE_NAME;
    }

    public void setSALE_NAME(String SALE_NAME) {
        this.SALE_NAME = SALE_NAME;
    }

    public String getORDER_STATUS() {
        return ORDER_STATUS;
    }

    public void setORDER_STATUS(String ORDER_STATUS) {
        this.ORDER_STATUS = ORDER_STATUS;
    }

    @Override
    public int compareTo(@NonNull ProcessListResp o) {
        if (this == o) {
            return 0;
        }
        try {
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date dt1 = df.parse(this.CREATE_DATE);
            Date dt2 = df.parse(o.CREATE_DATE);
            if (dt1.getTime() > dt2.getTime()) {
                return -1;
            } else if (dt1.getTime() < dt2.getTime()) {
                return 1;
            } else {
                return 0;
            }
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        return 0;
    }

}
